import { createApp } from "vue";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import App from "./App.vue";
import router from "./router"; // 新增路由导入
import "./mock/index";
import directive from "./directive";

const app = createApp(App);
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
//npm install element-plus@2.4.3
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";

//设置element-plus的语言为中文
app.use(ElementPlus, {
  locale: zhCn,
});
app.use(pinia);
app.use(router); // 使用路由

directive(app);
app.mount("#app");
